package cn.singno.bob.jpa.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSON;

import cn.singno.bob.jpa.annotation.core.DynamicSpecification;
import cn.singno.bob.jpa.base.impl.BaseServiceImpl;
import cn.singno.bob.jpa.dao.StudentDao;
import cn.singno.bob.jpa.entity.Student;

@Service
public class StudentServiceImpl extends BaseServiceImpl<Student, String> implements StudentService{

	@Autowired
	private StudentDao studentDao;
	
	@Override
	public List<Student> findcutM(Student student) {
		Specification predicate =  DynamicSpecification.toPredicate(student);
		System.out.println(JSON.toJSONString(predicate));
		return studentDao.findAll(predicate);
	}

}
